package org.huawei260.OD260;

import java.util.Scanner;

/**
 * @Auther: qingle
 * @Date: 2024/8/19-1:20
 * @Description:
 * 如果三个正整数A、B、C ，A² + B² = C² 则为勾股数，
 *
 * 如果ABC之间两两互质，即A与B，A与C，B与C均互质没有公约数，则称其为勾股数元组。
 *
 * 请求出给定 n ~ m 范围内所有的勾股数元组。
 * @version: 1.0
 */
public class O01勾股数 {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();
		for (int i = n; i < m; i++) {
			for (int j = i + 1; j < m; j++) {
//				for (int k = j + 1; k < m; k++) {
//					if (i*i + j*j == k*k && huzhi(i, j) && huzhi(i, k) && huzhi(j, k)) {
//						System.out.println(i + " " + j + " " + k );
//					}
//				}
				int k = (int) Math.sqrt(i*i + j*j);
				if (k > m) {
					break;
				}
//				if (k * k == i * i + j * j && huzhi(i, j) && huzhi(i, k) && huzhi(j, k)) {
//					System.out.println(i + " " + j + " " + k );
//				}
					if (k * k == i * i + j * j && gcd(i, j)==1 && gcd(i, k)==1  && gcd(k, j)==1 ) {
					System.out.println(i + " " + j + " " + k );
				}
			}
		}
		
	}


	// 最大公约数，辗转相除法
	private static int gcd(int a, int b) {
		return b == 0 ? a : gcd(b, a % b);
	}
	
	public static boolean huzhi(int a, int b) {
		boolean ishuzhi = true;
		if (a < b) {
			for (int i = 2; i < a; i++) {
				if (a % i == 0 && b % i == 0) {
					ishuzhi = false;
					break;
				}
			}
		}
		if (a > b) {
			for (int i = 2; i < a; i++) {
				if (a % i == 0 && b % i == 0) {
					ishuzhi = false;
					break;
				}
			}
		}
		if (a==b) {
			ishuzhi = false;
		}
		return ishuzhi;
	}
}
